﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TechMadeira.Core.Logging
{
    public class CompositeRecorder : IRecorder
    {
        public CompositeRecorder()
        {
            Recorders = new List<IRecorder>();
        }

        private List<IRecorder> Recorders { get; set; }

        public void Append( IRecorder aRecorder )
        {
            Recorders.Add( aRecorder );
        }

        public void Remove( IRecorder aRecorder )
        {
            Recorders.Remove( aRecorder );
        }

        public void Record( string aFormat, params object[] aArgs )
        {
            foreach ( var recorder in Recorders )
            {
                recorder.Record( aFormat, aArgs );
            }
        }
    }
}
